#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time: 2022/12/27 19:48
# @Author: 周健
# @Email: 907614893@qq.com
# @File：shipin_page.py
from pages.base_page import BasePage
from appium.webdriver.common.mobileby import MobileBy as By

class ShiPinPage(BasePage):
    share_locator = (By.XPATH,'//android.support.v7.widget.RecyclerView[@resource-id=\"com.gfeng.daydaycook:id/recyclerView\"]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.TextView[1]')
    weixin_locator = (By.XPATH,'//android.support.v7.widget.RecyclerView[@resource-id=\"com.gfeng.daydaycook:id/rv_share\"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[1]/android.widget.ImageView[2]')

    # 点击分享
    def click_share(self):
        self.driver.find_element(*self.share_locator).click()

    # 点击微信
    def click_weixin(self):
        self.driver.find_element(*self.weixin_locator).click()
